.class public Les/yt;
.super Ljava/lang/Object;
.source "BtScan.java"


# static fields
.field public static f:Z = false

.field public static g:Z = false

.field public static h:Z = false

.field public static i:Z = true

.field private static j:Les/yt;


# instance fields
.field private a:Z

.field private b:Les/y60;

.field private c:Ljava/util/Timer;

.field private d:Landroid/bluetooth/BluetoothAdapter;

.field private e:Z


# direct methods
.method static constructor <clinit>()V
    .locals 0

    return-void
.end method

.method private constructor <init>()V
    .locals 2

    .line 1
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    const/4 v0, 0x0

    .line 2
    iput-boolean v0, p0, Les/yt;->a:Z

    .line 3
    new-instance v1, Ljava/util/Timer;

    invoke-direct {v1}, Ljava/util/Timer;-><init>()V

    iput-object v1, p0, Les/yt;->c:Ljava/util/Timer;

    const/4 v1, 0x0

    .line 4
    iput-object v1, p0, Les/yt;->d:Landroid/bluetooth/BluetoothAdapter;

    .line 5
    iput-boolean v0, p0, Les/yt;->e:Z

    return-void
.end method

.method private k()Z
    .locals 1

    .line 1
    invoke-direct {p0}, Les/yt;->l()Z

    move-result v0

    if-nez v0, :cond_0

    const/4 v0, 0x0

    return v0

    .line 2
    :cond_0
    iget-object v0, p0, Les/yt;->d:Landroid/bluetooth/BluetoothAdapter;

    invoke-virtual {v0}, Landroid/bluetooth/BluetoothAdapter;->disable()Z

    move-result v0

    return v0
.end method

.method private l()Z
    .locals 3

    .line 1
    iget-object v0, p0, Les/yt;->d:Landroid/bluetooth/BluetoothAdapter;

    const/4 v1, 0x1

    if-eqz v0, :cond_0

    return v1

    .line 2
    :cond_0
    invoke-static {}, Landroid/bluetooth/BluetoothAdapter;->getDefaultAdapter()Landroid/bluetooth/BluetoothAdapter;

    move-result-object v0

    iput-object v0, p0, Les/yt;->d:Landroid/bluetooth/BluetoothAdapter;

    if-nez v0, :cond_1

    .line 3
    invoke-static {}, Lcom/estrongs/android/pop/FexApplication;->n()Lcom/estrongs/android/pop/FexApplication;

    move-result-object v0

    const v2, 0x7f1101c2

    invoke-static {v0, v2, v1}, Lcom/estrongs/android/ui/view/d;->a(Landroid/content/Context;II)V

    const/4 v0, 0x0

    return v0

    :cond_1
    return v1
.end method

.method public static m()Les/yt;
    .locals 1

    .line 1
    sget-object v0, Les/yt;->j:Les/yt;

    if-nez v0, :cond_0

    .line 2
    new-instance v0, Les/yt;

    invoke-direct {v0}, Les/yt;-><init>()V

    sput-object v0, Les/yt;->j:Les/yt;

    .line 3
    :cond_0
    sget-object v0, Les/yt;->j:Les/yt;

    return-object v0
.end method

.method private n()Z
    .locals 3

    .line 1
    invoke-direct {p0}, Les/yt;->l()Z

    move-result v0

    const/4 v1, 0x0

    if-nez v0, :cond_0

    return v1

    .line 2
    :cond_0
    iget-object v0, p0, Les/yt;->d:Landroid/bluetooth/BluetoothAdapter;

    invoke-virtual {v0}, Landroid/bluetooth/BluetoothAdapter;->getScanMode()I

    move-result v0

    const/16 v2, 0x17

    if-ne v0, v2, :cond_1

    const/4 v1, 0x1

    :cond_1
    return v1
.end method

.method private o()Z
    .locals 1

    .line 1
    invoke-direct {p0}, Les/yt;->l()Z

    move-result v0

    if-nez v0, :cond_0

    const/4 v0, 0x0

    return v0

    .line 2
    :cond_0
    iget-object v0, p0, Les/yt;->d:Landroid/bluetooth/BluetoothAdapter;

    invoke-virtual {v0}, Landroid/bluetooth/BluetoothAdapter;->isEnabled()Z

    move-result v0

    return v0
.end method

.method private p()V
    .locals 4

    .line 1
    iget-boolean v0, p0, Les/yt;->a:Z

    if-nez v0, :cond_0

    return-void

    .line 2
    :cond_0
    invoke-virtual {p0}, Les/yt;->f()Landroid/app/Activity;

    move-result-object v0

    if-eqz v0, :cond_1

    .line 3
    invoke-virtual {p0}, Les/yt;->f()Landroid/app/Activity;

    move-result-object v0

    invoke-static {v0}, Les/i20;->a(Landroid/content/Context;)V

    .line 4
    invoke-virtual {p0}, Les/yt;->f()Landroid/app/Activity;

    move-result-object v0

    new-instance v1, Landroid/content/Intent;

    invoke-direct {v1}, Landroid/content/Intent;-><init>()V

    invoke-virtual {p0}, Les/yt;->f()Landroid/app/Activity;

    move-result-object v2

    const-class v3, Lcom/estrongs/android/pop/bt/OBEXFtpServerService;

    .line 5
    invoke-virtual {v3}, Ljava/lang/Class;->getName()Ljava/lang/String;

    move-result-object v3

    .line 6
    invoke-virtual {v1, v2, v3}, Landroid/content/Intent;->setClassName(Landroid/content/Context;Ljava/lang/String;)Landroid/content/Intent;

    move-result-object v1

    invoke-virtual {v0, v1}, Landroid/app/Activity;->stopService(Landroid/content/Intent;)Z

    :cond_1
    const/4 v0, 0x0

    .line 7
    iput-boolean v0, p0, Les/yt;->a:Z

    return-void
.end method


# virtual methods
.method public a()Z
    .locals 5

    .line 1
    invoke-direct {p0}, Les/yt;->o()Z

    move-result v0

    const/4 v1, 0x1

    if-nez v0, :cond_0

    .line 2
    sput-boolean v1, Les/yt;->h:Z

    .line 3
    invoke-virtual {p0}, Les/yt;->h()V

    goto :goto_0

    .line 4
    :cond_0
    invoke-static {}, Les/i20;->g()Z

    move-result v0

    const v2, 0x7f1108ec

    if-eqz v0, :cond_2

    .line 5
    invoke-static {}, Lcom/estrongs/android/pop/FexApplication;->n()Lcom/estrongs/android/pop/FexApplication;

    move-result-object v0

    const v3, 0x7f1105db

    invoke-static {v0, v3, v1}, Lcom/estrongs/android/ui/view/d;->a(Landroid/content/Context;II)V

    .line 6
    invoke-virtual {p0}, Les/yt;->f()Landroid/app/Activity;

    move-result-object v0

    if-eqz v0, :cond_1

    .line 7
    new-instance v0, Lcom/estrongs/android/ui/dialog/b1;

    invoke-virtual {p0}, Les/yt;->f()Landroid/app/Activity;

    move-result-object v3

    invoke-static {}, Lcom/estrongs/android/pop/FexApplication;->n()Lcom/estrongs/android/pop/FexApplication;

    move-result-object v4

    invoke-virtual {v4, v2}, Landroid/app/Application;->getString(I)Ljava/lang/String;

    move-result-object v2

    iget-object v4, p0, Les/yt;->b:Les/y60;

    invoke-direct {v0, v3, v2, v4}, Lcom/estrongs/android/ui/dialog/b1;-><init>(Landroid/content/Context;Ljava/lang/String;Les/s80;)V

    invoke-virtual {v0}, Lcom/estrongs/android/ui/dialog/q;->show()V

    :cond_1
    return v1

    .line 8
    :cond_2
    invoke-virtual {p0}, Les/yt;->f()Landroid/app/Activity;

    move-result-object v0

    if-eqz v0, :cond_3

    .line 9
    new-instance v0, Les/y60;

    invoke-direct {v0}, Les/y60;-><init>()V

    iput-object v0, p0, Les/yt;->b:Les/y60;

    .line 10
    invoke-static {}, Lcom/estrongs/android/pop/FexApplication;->n()Lcom/estrongs/android/pop/FexApplication;

    move-result-object v3

    const v4, 0x7f110b54

    invoke-virtual {v3, v4}, Landroid/app/Application;->getString(I)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v0, v3}, Les/s80;->a(Ljava/lang/String;)V

    .line 11
    iget-object v0, p0, Les/yt;->b:Les/y60;

    new-instance v3, Lcom/estrongs/android/pop/p;

    invoke-direct {v3}, Lcom/estrongs/android/pop/p;-><init>()V

    invoke-virtual {v0, v3}, Les/s80;->a(Les/z80;)V

    .line 12
    new-instance v0, Lcom/estrongs/android/ui/dialog/b1;

    invoke-virtual {p0}, Les/yt;->f()Landroid/app/Activity;

    move-result-object v3

    invoke-static {}, Lcom/estrongs/android/pop/FexApplication;->n()Lcom/estrongs/android/pop/FexApplication;

    move-result-object v4

    invoke-virtual {v4, v2}, Landroid/app/Application;->getString(I)Ljava/lang/String;

    move-result-object v2

    iget-object v4, p0, Les/yt;->b:Les/y60;

    invoke-direct {v0, v3, v2, v4}, Lcom/estrongs/android/ui/dialog/b1;-><init>(Landroid/content/Context;Ljava/lang/String;Les/s80;)V

    invoke-virtual {v0}, Lcom/estrongs/android/ui/dialog/q;->show()V

    .line 13
    iget-object v0, p0, Les/yt;->b:Les/y60;

    invoke-virtual {v0}, Les/s80;->d()V

    const/4 v0, 0x0

    .line 14
    sput-boolean v0, Les/yt;->i:Z

    :cond_3
    :goto_0
    return v1
.end method

.method public a(Z)Z
    .locals 4

    .line 15
    invoke-direct {p0}, Les/yt;->o()Z

    move-result v0

    const/4 v1, 0x1

    if-nez v0, :cond_1

    if-eqz p1, :cond_0

    .line 16
    invoke-static {}, Lcom/estrongs/android/pop/FexApplication;->n()Lcom/estrongs/android/pop/FexApplication;

    move-result-object p1

    const v0, 0x7f1101d8

    invoke-static {p1, v0, v1}, Lcom/estrongs/android/ui/view/d;->a(Landroid/content/Context;II)V

    :cond_0
    const/4 p1, 0x0

    return p1

    .line 17
    :cond_1
    invoke-direct {p0}, Les/yt;->n()Z

    move-result p1

    if-nez p1, :cond_2

    .line 18
    invoke-virtual {p0}, Les/yt;->f()Landroid/app/Activity;

    move-result-object p1

    if-eqz p1, :cond_3

    .line 19
    new-instance v0, Landroid/content/Intent;

    const-string v2, "android.bluetooth.adapter.action.REQUEST_DISCOVERABLE"

    invoke-direct {v0, v2}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

    const/16 v2, 0x12c

    const-string v3, "android.bluetooth.adapter.extra.DISCOVERABLE_DURATION"

    .line 20
    invoke-virtual {v0, v3, v2}, Landroid/content/Intent;->putExtra(Ljava/lang/String;I)Landroid/content/Intent;

    const/16 v2, 0x17

    const-string v3, "android.bluetooth.adapter.extra.SCAN_MODE"

    .line 21
    invoke-virtual {v0, v3, v2}, Landroid/content/Intent;->putExtra(Ljava/lang/String;I)Landroid/content/Intent;

    const/16 v2, 0x100a

    .line 22
    :try_start_0
    invoke-virtual {p1, v0, v2}, Landroid/app/Activity;->startActivityForResult(Landroid/content/Intent;I)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    :catch_0
    move-exception p1

    .line 23
    invoke-virtual {p1}, Ljava/lang/Exception;->printStackTrace()V

    goto :goto_0

    .line 24
    :cond_2
    invoke-static {}, Lcom/estrongs/android/pop/FexApplication;->n()Lcom/estrongs/android/pop/FexApplication;

    move-result-object p1

    const v0, 0x7f1101d7

    invoke-static {p1, v0, v1}, Lcom/estrongs/android/ui/view/d;->a(Landroid/content/Context;II)V

    :cond_3
    :goto_0
    return v1
.end method

.method public b()V
    .locals 1

    .line 1
    iget-object v0, p0, Les/yt;->c:Ljava/util/Timer;

    if-nez v0, :cond_0

    return-void

    .line 2
    :cond_0
    :try_start_0
    invoke-virtual {v0}, Ljava/util/Timer;->cancel()V

    const/4 v0, 0x0

    .line 3
    iput-object v0, p0, Les/yt;->c:Ljava/util/Timer;
    :try_end_0
    .catch Ljava/lang/IllegalStateException; {:try_start_0 .. :try_end_0} :catch_0

    :catch_0
    return-void
.end method

.method public c()V
    .locals 1

    .line 1
    invoke-direct {p0}, Les/yt;->o()Z

    move-result v0

    if-nez v0, :cond_0

    .line 2
    iget-boolean v0, p0, Les/yt;->a:Z

    if-eqz v0, :cond_0

    .line 3
    invoke-direct {p0}, Les/yt;->p()V

    :cond_0
    return-void
.end method

.method public d()V
    .locals 4

    .line 1
    :try_start_0
    invoke-virtual {p0}, Les/yt;->f()Landroid/app/Activity;

    move-result-object v0

    if-eqz v0, :cond_0

    .line 2
    iget-boolean v0, p0, Les/yt;->a:Z

    if-eqz v0, :cond_0

    .line 3
    invoke-virtual {p0}, Les/yt;->f()Landroid/app/Activity;

    move-result-object v0

    invoke-static {v0}, Les/i20;->a(Landroid/content/Context;)V

    .line 4
    invoke-virtual {p0}, Les/yt;->f()Landroid/app/Activity;

    move-result-object v0

    new-instance v1, Landroid/content/Intent;

    invoke-direct {v1}, Landroid/content/Intent;-><init>()V

    invoke-virtual {p0}, Les/yt;->f()Landroid/app/Activity;

    move-result-object v2

    const-class v3, Lcom/estrongs/android/pop/bt/OBEXFtpServerService;

    .line 5
    invoke-virtual {v3}, Ljava/lang/Class;->getName()Ljava/lang/String;

    move-result-object v3

    .line 6
    invoke-virtual {v1, v2, v3}, Landroid/content/Intent;->setClassName(Landroid/content/Context;Ljava/lang/String;)Landroid/content/Intent;

    move-result-object v1

    invoke-virtual {v0, v1}, Landroid/app/Activity;->stopService(Landroid/content/Intent;)Z

    const/4 v0, 0x0

    .line 7
    iput-boolean v0, p0, Les/yt;->a:Z

    .line 8
    :cond_0
    sget-boolean v0, Les/yt;->g:Z

    if-eqz v0, :cond_1

    .line 9
    invoke-static {}, Les/i20;->j()V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    :catch_0
    move-exception v0

    .line 10
    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V

    :cond_1
    :goto_0
    return-void
.end method

.method public e()Z
    .locals 1

    const/4 v0, 0x1

    .line 1
    invoke-virtual {p0, v0}, Les/yt;->a(Z)Z

    move-result v0

    return v0
.end method

.method public f()Landroid/app/Activity;
    .locals 1

    .line 1
    invoke-static {}, Lcom/estrongs/android/pop/view/FileExplorerActivity;->c1()Lcom/estrongs/android/pop/view/FileExplorerActivity;

    move-result-object v0

    return-object v0
.end method

.method public g()V
    .locals 4

    .line 1
    iget-object v0, p0, Les/yt;->c:Ljava/util/Timer;

    if-nez v0, :cond_0

    .line 2
    new-instance v0, Ljava/util/Timer;

    invoke-direct {v0}, Ljava/util/Timer;-><init>()V

    iput-object v0, p0, Les/yt;->c:Ljava/util/Timer;

    .line 3
    :cond_0
    iget-object v0, p0, Les/yt;->c:Ljava/util/Timer;

    new-instance v1, Les/yt$a;

    invoke-direct {v1, p0}, Les/yt$a;-><init>(Les/yt;)V

    const-wide/32 v2, 0x49bb0

    invoke-virtual {v0, v1, v2, v3}, Ljava/util/Timer;->schedule(Ljava/util/TimerTask;J)V

    return-void
.end method

.method public h()V
    .locals 3

    .line 1
    invoke-direct {p0}, Les/yt;->o()Z

    move-result v0

    if-nez v0, :cond_0

    .line 2
    :try_start_0
    invoke-static {}, Les/i20;->h()V

    .line 3
    invoke-virtual {p0}, Les/yt;->f()Landroid/app/Activity;

    move-result-object v0

    if-eqz v0, :cond_1

    .line 4
    new-instance v0, Landroid/content/Intent;

    const-string v1, "android.bluetooth.adapter.action.REQUEST_ENABLE"

    invoke-direct {v0, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

    .line 5
    invoke-virtual {p0}, Les/yt;->f()Landroid/app/Activity;

    move-result-object v1

    invoke-virtual {v1, v0}, Landroid/app/Activity;->startActivity(Landroid/content/Intent;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    .line 6
    :catch_0
    invoke-static {}, Lcom/estrongs/android/pop/FexApplication;->n()Lcom/estrongs/android/pop/FexApplication;

    move-result-object v0

    const v1, 0x7f1101d8

    const/4 v2, 0x1

    invoke-static {v0, v1, v2}, Lcom/estrongs/android/ui/view/d;->a(Landroid/content/Context;II)V

    goto :goto_0

    .line 7
    :cond_0
    iget-boolean v0, p0, Les/yt;->a:Z

    if-nez v0, :cond_1

    .line 8
    invoke-virtual {p0}, Les/yt;->i()V

    :cond_1
    :goto_0
    return-void
.end method

.method public i()V
    .locals 5

    .line 1
    iget-boolean v0, p0, Les/yt;->a:Z

    if-nez v0, :cond_3

    iget-boolean v0, p0, Les/yt;->e:Z

    if-eqz v0, :cond_0

    goto :goto_0

    :cond_0
    const/4 v0, 0x1

    .line 2
    iput-boolean v0, p0, Les/yt;->e:Z

    .line 3
    invoke-virtual {p0}, Les/yt;->f()Landroid/app/Activity;

    move-result-object v1

    if-eqz v1, :cond_1

    .line 4
    invoke-virtual {p0}, Les/yt;->f()Landroid/app/Activity;

    move-result-object v1

    invoke-static {v1}, Les/i20;->b(Landroid/content/Context;)V

    .line 5
    invoke-virtual {p0}, Les/yt;->f()Landroid/app/Activity;

    move-result-object v1

    new-instance v2, Landroid/content/Intent;

    invoke-direct {v2}, Landroid/content/Intent;-><init>()V

    invoke-virtual {p0}, Les/yt;->f()Landroid/app/Activity;

    move-result-object v3

    const-class v4, Lcom/estrongs/android/pop/bt/OBEXFtpServerService;

    .line 6
    invoke-virtual {v4}, Ljava/lang/Class;->getName()Ljava/lang/String;

    move-result-object v4

    .line 7
    invoke-virtual {v2, v3, v4}, Landroid/content/Intent;->setClassName(Landroid/content/Context;Ljava/lang/String;)Landroid/content/Intent;

    move-result-object v2

    invoke-virtual {v1, v2}, Landroid/app/Activity;->startService(Landroid/content/Intent;)Landroid/content/ComponentName;

    .line 8
    :cond_1
    iput-boolean v0, p0, Les/yt;->a:Z

    .line 9
    invoke-static {}, Lcom/estrongs/android/pop/view/FileExplorerActivity;->a1()Lcom/estrongs/android/pop/view/FileExplorerActivity;

    move-result-object v1

    if-eqz v1, :cond_2

    .line 10
    invoke-virtual {v1}, Lcom/estrongs/android/pop/view/FileExplorerActivity;->Z()Lcom/estrongs/android/view/FileGridViewWrapper;

    move-result-object v1

    if-eqz v1, :cond_2

    .line 11
    invoke-virtual {v1, v0}, Lcom/estrongs/android/view/FileGridViewWrapper;->d(Z)V

    .line 12
    :cond_2
    invoke-virtual {p0}, Les/yt;->e()Z

    const/4 v0, 0x0

    .line 13
    iput-boolean v0, p0, Les/yt;->e:Z

    :cond_3
    :goto_0
    return-void
.end method

.method public j()V
    .locals 1

    .line 1
    invoke-direct {p0}, Les/yt;->o()Z

    move-result v0

    if-eqz v0, :cond_1

    .line 2
    iget-boolean v0, p0, Les/yt;->a:Z

    if-eqz v0, :cond_0

    .line 3
    invoke-direct {p0}, Les/yt;->p()V

    .line 4
    :cond_0
    invoke-direct {p0}, Les/yt;->k()Z

    :cond_1
    return-void
.end method
